import React, { Component } from 'react';

// 导入路由
import {
  BrowserRouter as Router,
  Route,
  Switch,
  Redirect,
} from 'react-router-dom';

// 导入页面组件
import Login from './pages/Login';
import Layout from './pages/Layout';

export default class App extends Component {
  render() {
    return (
      <Router>
        {/* 路由规则 */}
        <Switch>
          <Redirect exact from="/" to="/layout"></Redirect>
          <Route path="/layout" component={Layout}></Route>
          <Route path="/login" component={Login}></Route>
        </Switch>
      </Router>
    );
  }
}
